<?php
/**
 * Albireo Kernel
 *
 * @copyright  Copyright (c) 2011 Celebrio Software
 * @package    Kernel
 */
namespace Celebrio\AccessControl;

use Nette\Object;

/**
 * Base user
 *
 * @author pavel
 */

abstract class BaseUser extends Object {
    
    /** @var int */
    protected $user_id = 0;

    /** @var string */
    protected $first_name = null;

    /** @var string */
    protected $last_name = null;


    /**
     * @param string $first_name
     */
    public function setFirstName($first_name) {
        $this->first_name = $first_name;
    }

    /**
     * @return string
     */
    public function getFirstName() {
        return $this->first_name;
    }

    /**
     * @param string $last_name
     */
    public function setLastName($last_name) {
        $this->last_name = $last_name;
    }

    /**
     * @return string
     */
    public function getLastName() {
        return $this->last_name;
    }

    /**
     * @param int $user_id
     */
    public function setUserId($user_id) {
        $this->user_id = $user_id;
    }

    /**
     * @return int
     */
    public function getUserId() {
        return $this->user_id;
    }

    public function getName() {
        $result = trim($this->getFirstName() . " " . $this->getLastName());
        return $result === "" ? _("Unknown") : $result;
    }
}

